package com.jiyun.entity.vo;

import lombok.Data;
import lombok.ToString;

@Data
@ToString
public class ResponseBean {
    private Integer code;
    private String msg;
    private Object data;

    /**
     * 正确
     * @param data
     * @return
     */
    public static ResponseBean success(String msg,Object data){
        ResponseBean resultResponse = new ResponseBean();
        resultResponse.setCode(1);
        resultResponse.setMsg(msg);
        resultResponse.setData(data);
        return resultResponse;
    }

    /**
     * 错误
     * @return
     */
    public static ResponseBean error(String msg){
        ResponseBean resultResponse = new ResponseBean();
        resultResponse.setCode(2);
        resultResponse.setMsg(msg);
        return resultResponse;
    }
}
